package com.youngball.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.youngball.entity.SysTest;
import com.youngball.mapper.SysTestMapper;
import com.youngball.service.SysTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * Created by liaopingzhu on 2016/11/5.
 */
@Component
public class SysTestServiceImpl implements SysTestService {

    @Autowired
    private SysTestMapper sysTestMapper;

    @Override
    public PageInfo<SysTest> findAll(Map map) {
        PageHelper.startPage(Integer.parseInt(map.get("pageIndex").toString()),
                Integer.parseInt(map.get("pageSize").toString()), true);
        List<SysTest> sysTests = sysTestMapper.findAll();
        PageInfo<SysTest> pageInfo=new PageInfo<SysTest>(sysTests);
        return pageInfo;
    }
}
